export default (url,method = 'GET',data={},title = '加载中', header = {
	'content-type': 'application/x-www-form-urlencoded'
})=>{
	return new Promise((resolve,reject)=>{
		uni.showLoading({
			title,
		})
		uni.request({
			url,
			data,
			header,
			method,
			success(e){
				if(e.data.err === 1 || e.data.msg === "失败"){
					return reject(e.data);
				}
				if(e.data.err === 0){
					return resolve(e.data);
				}
				if(e.errMsg === "request:ok"){
					return resolve(e.data);
				}else{
			       return reject(e)
				}
			},
			fail(e){
				reject(e)
			},
			complete(){
				uni.hideLoading();
			}
		})
	})
	
}